#include <bits/stdc++.h>
// 2025/02/04
// tag: 
// Author: Zhang Muen
using namespace std;

#define int long long

class MQueue {
private:
    deque<int> q, pos;

public:
    void push(int x, int i)
    {
        while (!q.empty() && q.back() < x)
            q.pop_back(), pos.pop_back();
        q.push_back(x), pos.push_back(i);
    }
    void pop(int i)
    {
        if (!pos.empty() && pos.front() <= i)
            q.pop_front(), pos.pop_front();
    }
    int get_max()
    {
        return q.front();
    }
};

int n, l, r, ice[200001], dp[200001];

signed main()
{
    cin >> n >> l >> r;
    for (int i = 0; i <= n; i++)
        cin >> ice[i];
    MQueue q;
    int ans = INT_MIN;
    q.push(0, 0);
    memset(dp, -0x3f, sizeof(dp));
    for (int i = l; i <= n; i++) {
        q.pop(i - r - 1);
        q.push(dp[i - l], i - l);
        dp[i] = q.get_max() + ice[i];
        if (i + r > n)
            ans = max(ans, dp[i]);
    }
    cout << ans;
    return 0;
}